﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ClassLibrary.DAO;
using System.Configuration; 
namespace ClassLibrary.SMTP
{
    public class MailProperties
    {
        private string _smtpHost = "localhost";
        private int _smtpPort = 465;
        private string _smtpSubject = "";
        private string _smtpDisplayName = "";
        private string _smtpFrom = "";
        private string _smtpTo = "";
        private string _smtpBody = "";
        private string _attachedFiles = "";
        private string _smtpUsername = "";
        private string _smtpPassword = "";
        private int _TimeOut = 60;

        public int TimeOut
        {
            get { return _TimeOut; }
            set { _TimeOut = value; }
        }
        public string SMTPHost
        {
            get
            {
                return _smtpHost;
            }
            set
            {
                _smtpHost = value;
            }
        }
        public int SMTPPort
        {
            get
            {
                return _smtpPort;
            }
            set
            {
                _smtpPort = value;
            }
        }
        public string SMTPSubject
        {
            get
            {
                return _smtpSubject;
            }
            set
            {
                _smtpSubject = value;
            }
        }
        public string SMTPDisplayName
        {
            get
            {
                return _smtpDisplayName;
            }
            set
            {
                _smtpDisplayName = value;
            }
        }
        public string SMTPFrom
        {
            get
            {
                return _smtpFrom;
            }
            set
            {
                _smtpFrom = value;
            }
        }
        public string SMTPTo
        {
            get
            {
                return _smtpTo;
            }
            set
            {
                _smtpTo = value;
            }
        }
        public string SMTPBody
        {
            get
            {
                return _smtpBody;
            }
            set
            {
                _smtpBody = value;
            }
        }
        public string SMTPUsername
        {
            get { return _smtpUsername; }
            set { _smtpUsername = value; }
        }
        public string SMTPPassword
        {
            get { return _smtpPassword; }
            set { _smtpPassword = value; }
        }

        public string SMTPAttachedFiles
        {
            get
            {
                return _attachedFiles;
            }
            set
            {
                _attachedFiles = value;
            }
        }

        public void SendMail(bool IsAsynchronous)
        {
            SMTPMail smtpMail = new SMTPMail();
            smtpMail.SendEmail(this, true, IsAsynchronous);

        }

        public void SendMail(bool IsAsynchronous, string PickupFolderLocation)
        {
            SMTPMail smtpMail = new SMTPMail();
            smtpMail.SendEmail(this, true, IsAsynchronous, PickupFolderLocation);
        }
    }
}
